package com.itcam.thread_;

/**
 * Author:Cammy.Wu
 * Date:2024-05-10
 * Description:
 */

public class ThreadDemo02 {
    /*
        Java程序默认是多线程的，程序启动后默认会存在两条线程
            1.主线程
            2.垃圾回收线程
     */
    public static void main(String[] args) {
        for (int i = 0; i <= 2000; i++) {
            System.out.println("main线程被执行了");
        }

        MyThread myThread = new MyThread();
        myThread.start();
    }
}

class Demo{
    @Override
    protected void finalize() throws Throwable {
        System.out.println("垃圾被清理了");
    }
}
